package center.leon.zoocloudsentinel.controller;

import center.leon.zoocloudsentinel.service.HelloService;
import center.leon.zoocommon.common.Response;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : Leon on XXM Mac
 * @since : create in 2024/8/19 21:36
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Resource
    private HelloService helloService;

    @GetMapping(value = "/world")
    public Response<String> helloWorld() throws BlockException {
        Response<String> response = helloService.helloWorld();
        return Response.success(response.getData());
    }
}
